package com.basker.pisces.domain.value;

import com.basker.pisces.domain.value.meta.StatusOption;

public class StatusValue extends StatusOption implements IValueObject {

    public static final StatusValue EMPTY = new EmptyStatusValue();

    public StatusValue(Integer value, String displayName) {
        super(value, displayName);
    }

    public StatusValue(StatusOption option) {
        super(option.getStatusValue(), option.getDisplayName());
    }

    private StatusValue() {
        super(null, "");
    }

    @Override
    public Object getDataValue() {
        return this.getStatusValue();
    }

    @Override
    public String getPresentValue() {
        return this.getDisplayName();
    }

    @Override
    public boolean isEmpty() {
        return this.getStatusValue() == null;
    }

    private static final class EmptyStatusValue extends StatusValue {

        @Override
        public Object getDataValue() {
            return null;
        }

        @Override
        public String getDisplayName() {
            return "";
        }

        @Override
        public String getPresentValue() {
            return "";
        }

        @Override
        public Integer getStatusValue() {
            return null;
        }
    }

}
